package com.itheima.demo5;

import java.io.*;

public class IODemo8 {
    public static void main(String[] args) throws IOException {

        //创建字节缓冲区
        BufferedInputStream bis = new BufferedInputStream(new FileInputStream("a.txt"));
        BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream("copy2.txt"));

        //遍历
        byte[] arr = new byte[1024] ;
        int b ;
        while ((b = bis.read(arr)) != -1){
            bos.write(arr,0,b);

        }
        bis.close();
        bos.close();

    }
}
